-- This shows how the version affects which code points that actually are defined.
-- © Erland Sommarskog 2025.
USE Latin1_General_CI_AS
go
-- This is again the Swedish shrimp sandwich, but it is mispelled. Instead of a
-- ring, the "å" is written with a dot on top. Run these statements, are the 
-- results the expected ones?
DECLARE @sandwich nvarchar(10) = N'räksmörgȧs'
SELECT upper(@sandwich) AS Upper, 
       charindex(N'ȧ', @sandwich) AS Charindex,
       replace(@sandwich, N'ȧ', N'å') AS Replace, 
       IIF (@sandwich = N'räksmörgs', 'Equal', 'Not equal') IsEqual
-- The strange results are due that in a version-80 collation, this code point,
-- U+0227 is not defined. We are lured by SSMS that shows a character because
-- it uses much later version of Unicode.
go
-- Create a database for a version-100 collation where this code point is 
-- defined, and move to it.
CREATE DATABASE Latin1_General_100_CI_AS COLLATE Latin1_General_100_CI_AS
go
USE Latin1_General_100_CI_AS
go
-- All results are now as expected.
DECLARE @sandwich nvarchar(10) = N'räksmörgȧs'
SELECT upper(@sandwich) AS Upper, 
       charindex(N'ȧ', @sandwich) AS Charindex,
       replace(@sandwich, N'ȧ', N'å') AS Replace, 
       IIF (@sandwich = N'räksmörgs', 'Equal', 'Not equal') IsEqual
go
